/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

package br.faesa.acervo.business.ejb;

import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author Eric Rosetti Lessa
 */
public class Servicos {
    
    
    public static AlunoServiceRemote lookupEJBAluno(){
        
        InitialContext context;
        
        try {
            context = new InitialContext();
            AlunoServiceRemote alunoService = (AlunoServiceRemote) context.lookup(
                    "java:global/acervo/acervo-ejb/AlunoService!br.faesa.acervo.business.ejb.AlunoServiceRemote");
            context.close();
            
            return alunoService;
        } catch (NamingException ex) {
            throw new RuntimeException(ex);
        }
        
    }
    
    public static ReservaServiceRemote lookupEJBReserva(){
        
        InitialContext context;
        
        try {
            context = new InitialContext();
            ReservaServiceRemote reservaService = (ReservaServiceRemote) context.lookup(
                    "java:global/acervo/acervo-ejb/ReservaService!br.faesa.acervo.business.ejb.ReservaServiceRemote");
            
            context.close();
            
            return reservaService;
        } catch (NamingException ex) {
            throw new RuntimeException(ex);
        }
        
    }
    
}

